package com.haixiaoke.saas.house.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.house.domain.HouseFacilities;
import com.haixiaoke.saas.house.mapper.HouseFacilitiesMapper;
import com.haixiaoke.saas.house.service.IHouseFacilitiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 服务设施Service业务层处理
 * 
 * @author panda
 * @date 2025-06-25
 */
@Service
public class HouseFacilitiesServiceImpl implements IHouseFacilitiesService {
    @Autowired
    private HouseFacilitiesMapper houseFacilitiesMapper;

    /**
     * 查询服务设施
     * 
     * @param facilitiesId 服务设施主键
     * @return 服务设施
     */
    @Override
    public HouseFacilities selectHouseFacilitiesByFacilitiesId(Long facilitiesId) {
        return houseFacilitiesMapper.selectHouseFacilitiesByFacilitiesId(facilitiesId);
    }

    /**
     * 查询服务设施列表
     * 
     * @param houseFacilities 服务设施
     * @return 服务设施
     */
    @Override
    public List<HouseFacilities> selectHouseFacilitiesList(HouseFacilities houseFacilities) {
        return houseFacilitiesMapper.selectHouseFacilitiesList(houseFacilities);
    }

    /**
     * 新增服务设施
     * 
     * @param houseFacilities 服务设施
     * @return 结果
     */
    @Override
    public int insertHouseFacilities(HouseFacilities houseFacilities) {
        houseFacilities.setCreateTime(DateUtils.getNowDate());
        return houseFacilitiesMapper.insertHouseFacilities(houseFacilities);
    }

    /**
     * 修改服务设施
     * 
     * @param houseFacilities 服务设施
     * @return 结果
     */
    @Override
    public int updateHouseFacilities(HouseFacilities houseFacilities) {
        houseFacilities.setUpdateTime(DateUtils.getNowDate());
        return houseFacilitiesMapper.updateHouseFacilities(houseFacilities);
    }

    /**
     * 批量删除服务设施
     * 
     * @param facilitiesIds 需要删除的服务设施主键
     * @return 结果
     */
    @Override
    public int deleteHouseFacilitiesByFacilitiesIds(Long[] facilitiesIds) {
        return houseFacilitiesMapper.deleteHouseFacilitiesByFacilitiesIds(facilitiesIds);
    }

    /**
     * 删除服务设施信息
     * 
     * @param facilitiesId 服务设施主键
     * @return 结果
     */
    @Override
    public int deleteHouseFacilitiesByFacilitiesId(Long facilitiesId) {
        return houseFacilitiesMapper.deleteHouseFacilitiesByFacilitiesId(facilitiesId);
    }

    @Override
    public List<HouseFacilities> selectHouseFacilitiesByFacilitiesIds(List<Long> facilitiesIds) {
        return houseFacilitiesMapper.selectHouseFacilitiesByFacilitiesIds(facilitiesIds);
    }
}
